#FROM node:16.15.1 AS builder
FROM node:18 AS builder
COPY . /usr/app     
WORKDIR /usr/app

RUN cd /usr/app  &&  npm install -g npm && npm install --legacy-peer-deps &&npm run build:prod

FROM nginx AS worker
RUN mkdir -p /data/nav/dist
COPY --from=builder /usr/app/dist /data/adm
COPY --from=builder /usr/app/*.conf /etc/nginx/conf.d/
ADD nginx/nginx.conf /etc/nginx/nginx.conf
#CMD ["nginx -s reload"]